//获取当前环境   开发develop   体验trial   正式release
const evn =  wx.getAccountInfoSync().miniProgram.envVersion
const baseurl = {
  develop: 'https://api-hmugo-web.itheima.net',   //域名来自视频
  trial:'',
  release:''
}
export default function request(options){
  return new Promise((reslove,reject)=>{
    wx.request({
      url: baseurl[evn]+options.url,
      method: options.method || 'GET',
      data: options.data || {},
      success(res){
        reslove(res.data)
      },
      fail(err){
        reject(err)
      }
    })
  })
}